<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2008 XBRL International. All Rights Reserved. -->
<?xml-stylesheet type="text/xsl" href="../stylesheets/conformanceFunction.xsl"?>
<testcase
  xmlns="http://xbrl.org/2008/conformance"
  xmlns:reg="http://xbrl.org/2008/registry"
  xmlns:fcn="http://xbrl.org/2008/function"
  xmlns:cfcn="http://xbrl.org/2008/conformance/function"
  xmlns:xbrli="http://www.xbrl.org/2003/instance"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xfi="http://www.xbrl.org/2008/function/instance"
  xmlns:xfie="http://www.xbrl.org/2008/function/instance/error"
  xmlns:xqt-err="http://www.w3.org/2005/xqt-errors"
  xmlns:concept="http://xbrl.org/formula/conformance/example" 
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="
  http://xbrl.org/2008/registry ../schemas/registry.xsd
  http://xbrl.org/2008/function ../schemas/function.xsd
  http://xbrl.org/2008/conformance ../schemas/conformance.xsd
  http://xbrl.org/2008/conformance/function ../schemas/conformanceFunction.xsd
  ">
  <owners>
    <reg:owner id="herm">
      <reg:name>Herm Fischer</reg:name>
      <reg:affiliation>UBMatrix / Mark V Systems</reg:affiliation>
      <reg:email>fischer@markv.com</reg:email>
     <reg:assumedOwnership moment="2008-02-05T15:14:00" />
    </reg:owner>
  </owners>

  <number>90203</number>

  <name>Function test for xfi:concept-custom-attribute</name>

  <documentation>
    <xhtml:p>
      Tests of function xfi:concept-custom-attribute($concept-name as xs:QName, $attribute-name as xs:QName) as xs:string
      </xhtml:p>
  </documentation>

  <reference xlink:type="simple" xlink:href="http://www.xbrl.org/Specification/XF-PWD-2006-12-07.htm#_Toc152670666"/>

  <variation id="V-01">
    <name>Returns correct attribute for c1 concept a1 attribute</name>
    <documentation>
      <xhtml:p>
        Tests that element returned is attribute of specified concept.
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema readMeFirst="true" id="V01" xlink:type="simple" xlink:href="concept-custom-attribute.xsd"/>
      <cfcn:call file="V01">
        xfi:concept-custom-attribute(
          (: concept-name argument :) 
          QName('http://xbrl.org/formula/conformance/example','concept:c1'), 
          (: attribute-name argument :) 
          QName('http://xbrl.org/formula/conformance/example','concept:a1s')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         $result instance of xs:string and  (: expected object type :)
         count( $result ) eq 1 and          (: expect arity :)
         $result eq "aaa001"                (: expected value :) 
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-02">
    <name>Returns correct attribute for c1 concept a2 attribute</name>
    <documentation>
      <xhtml:p>
        Tests that element returned is attribute of specified concept.
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema readMeFirst="true" id="V02" xlink:type="simple" xlink:href="concept-custom-attribute.xsd"/>
      <cfcn:call file="V02">
        xfi:concept-custom-attribute(
          (: concept-name argument :) 
          QName('http://xbrl.org/formula/conformance/example','concept:c1'), 
          (: attribute-name argument :) 
          QName('http://xbrl.org/formula/conformance/example','concept:a2s')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         $result instance of xs:string and  (: expected object type :)
         count( $result ) eq 1 and          (: expect arity :)
         $result eq "bbb001"                (: expected value :) 
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-03">
    <name>Returns correct attribute for c1 concept a3 (qname) attribute</name>
    <documentation>
      <xhtml:p>
        Tests that element returned is attribute of specified concept.
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema readMeFirst="true" id="V03" xlink:type="simple" xlink:href="concept-custom-attribute.xsd"/>
      <cfcn:call file="V03">
        xfi:concept-custom-attribute(
          (: concept-name argument :) 
          QName('http://xbrl.org/formula/conformance/example','concept:c1'), 
          (: attribute-name argument :) 
          QName('http://xbrl.org/formula/conformance/example','concept:a3qn')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         $result instance of xs:QName and   (: expected object type :)
         count( $result ) eq 1 and          (: expect arity :)
         $result eq                         (: expected value is a QName :)
           QName('http://xbrl.org/formula/conformance/example/myStuff','my-c1') 
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-04">
    <name>Returns correct attribute for t1 tuple a1 attribute</name>
    <documentation>
      <xhtml:p>
        Tests that element returned is attribute of specified concept.
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema readMeFirst="true" id="V04" xlink:type="simple" xlink:href="concept-custom-attribute.xsd"/>
      <cfcn:call file="V04">
        xfi:concept-custom-attribute(
          (: concept-name argument :) 
          QName('http://xbrl.org/formula/conformance/example','concept:t1'), 
          (: attribute-name argument :) 
          QName('http://xbrl.org/formula/conformance/example','concept:a1s') 
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         $result instance of xs:string and  (: expected object type :)
         count( $result ) eq 1 and            (: expect arity :)
         $result eq "ttt001"                (: expected value :) 
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-05">
    <name>Returns empty sequence for c2 absent a1 attribute</name>
    <documentation>
      <xhtml:p>
        Tests that empty sequence is  returned when attribute is absent.
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema readMeFirst="true" id="V05" xlink:type="simple" xlink:href="concept-custom-attribute.xsd"/>
      <cfcn:call file="V05">
        xfi:concept-custom-attribute(
          (: concept-name argument :) 
          QName('http://xbrl.org/formula/conformance/example','concept:c2'), 
          (: attribute-name argument :) 
          QName('http://xbrl.org/formula/conformance/example','concept:a1s')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         empty( $result )      (: nothing returned for missing attribute :)
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-06">
    <name>Returns correct attribute for t1 tuple a3 qname attribute</name>
    <documentation>
      <xhtml:p>
        Tests that element returned is attribute of specified concept.
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema readMeFirst="true" id="V06" xlink:type="simple" xlink:href="concept-custom-attribute.xsd"/>
      <cfcn:call file="V06">
        xfi:concept-custom-attribute(
          (: concept-name argument :) 
          QName('http://xbrl.org/formula/conformance/example','concept:t1'), 
          (: attribute-name argument :) 
          QName('http://xbrl.org/formula/conformance/example','concept:a3qn') 
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         $result instance of xs:QName and   (: expected object type :)
         count( $result ) eq 1 and          (: expect arity :)
         $result eq                         (: expected value is a QName :)
           QName('http://xbrl.org/formula/conformance/example/myStuff','my-t1') 
      </cfcn:test>
    </outputs>
  </variation>

  <revisions>
    <reg:revision on="2008-02-05T15:14:00" by="herm">
      <xhtml:p>
        Created the test case.
      </xhtml:p>
    </reg:revision>
  </revisions>

</testcase>




